import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_utils/flutter_utils.dart';

void main() {
  group('color util test', () {
    test('computeColor test', () {
      var ratios = <double>[0, 0.5, 0.7];
      var colors = [Colors.red, Colors.orange, Colors.yellow];
      final computeColor1 = ColorUtil.computeColor(0.5, ratios, colors);
      final computeColor2 = ColorUtil.computeColor(0.3, ratios, colors);
      final computeColor3 = ColorUtil.computeColor(1, ratios, colors);

      expect(computeColor1, Colors.orange);
      expect(computeColor2, Color.lerp(Colors.red, Colors.orange, 0.3 / 0.5));
      expect(computeColor3, Colors.yellow);
    });
  });
}
